<?php

/**
 * Partido form base class.
 *
 * @method Partido getObject() Returns the current form's model object
 *
 * @package    ehockey
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BasePartidoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                            => new sfWidgetFormInputHidden(),
      'fecha'                         => new sfWidgetFormDate(),
      'nro_fecha'                     => new sfWidgetFormInputText(),
      'nro_rueda'                     => new sfWidgetFormInputText(),
      'local_id'                      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Local'), 'add_empty' => false)),
      'visitante_id'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Visitante'), 'add_empty' => false)),
      'estado'                        => new sfWidgetFormChoice(array('choices' => array('Sin imprimir' => 'Sin imprimir', 'Planilla abierta' => 'Planilla abierta', 'Pendiente verificacion' => 'Pendiente verificacion', 'Aceptado' => 'Aceptado', 'Disputado' => 'Disputado', 'Suspendida' => 'Suspendida'))),
      'estado_federacion'             => new sfWidgetFormChoice(array('choices' => array('Pendiente' => 'Pendiente', 'Procesado' => 'Procesado', 'Cerrado' => 'Cerrado', 'Contabilizado' => 'Contabilizado'))),
      'resultado_local'               => new sfWidgetFormInputText(),
      'resultado_visitante'           => new sfWidgetFormInputText(),
      'resultado_corregido_local'     => new sfWidgetFormInputText(),
      'resultado_corregido_visitante' => new sfWidgetFormInputText(),
      'jugado_en'                     => new sfWidgetFormInputText(),
      'torneo_id'                     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Torneo'), 'add_empty' => false)),
      'goleadores_local'              => new sfWidgetFormInputText(),
      'dt_local'                      => new sfWidgetFormInputText(),
      'capitan_local'                 => new sfWidgetFormInputText(),
      'pf_local'                      => new sfWidgetFormInputText(),
      'medico_local'                  => new sfWidgetFormInputText(),
      'juez_de_mesa_local'            => new sfWidgetFormInputText(),
      'arbitro_local'                 => new sfWidgetFormInputText(),
      'goleadores_visitante'          => new sfWidgetFormInputText(),
      'dt_visitante'                  => new sfWidgetFormInputText(),
      'capitan_visitante'             => new sfWidgetFormInputText(),
      'pf_visitante'                  => new sfWidgetFormInputText(),
      'medico_visitante'              => new sfWidgetFormInputText(),
      'juez_de_mesa_visitante'        => new sfWidgetFormInputText(),
      'arbitro_visitante'             => new sfWidgetFormInputText(),
      'observaciones'                 => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'                            => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'fecha'                         => new sfValidatorDate(),
      'nro_fecha'                     => new sfValidatorInteger(),
      'nro_rueda'                     => new sfValidatorInteger(),
      'local_id'                      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Local'))),
      'visitante_id'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Visitante'))),
      'estado'                        => new sfValidatorChoice(array('choices' => array(0 => 'Sin imprimir', 1 => 'Planilla abierta', 2 => 'Pendiente verificacion', 3 => 'Aceptado', 4 => 'Disputado', 5 => 'Suspendida'), 'required' => false)),
      'estado_federacion'             => new sfValidatorChoice(array('choices' => array(0 => 'Pendiente', 1 => 'Procesado', 2 => 'Cerrado', 3 => 'Contabilizado'), 'required' => false)),
      'resultado_local'               => new sfValidatorInteger(array('required' => false)),
      'resultado_visitante'           => new sfValidatorInteger(array('required' => false)),
      'resultado_corregido_local'     => new sfValidatorInteger(array('required' => false)),
      'resultado_corregido_visitante' => new sfValidatorInteger(array('required' => false)),
      'jugado_en'                     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'torneo_id'                     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Torneo'))),
      'goleadores_local'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'dt_local'                      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'capitan_local'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pf_local'                      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'medico_local'                  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'juez_de_mesa_local'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'arbitro_local'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'goleadores_visitante'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'dt_visitante'                  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'capitan_visitante'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pf_visitante'                  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'medico_visitante'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'juez_de_mesa_visitante'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'arbitro_visitante'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'observaciones'                 => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('partido[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Partido';
  }

}
